package com.seagull.core.http.service.impl;

import com.commons.model.Page;
import com.seagull.core.dao.CityDao;
import com.seagull.core.http.controller.req.ReqBase;
import com.seagull.core.http.service.CityService;
import com.seagull.core.model.City;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CityServiceImpl implements CityService {

    @Autowired
    private CityDao cityDao;

    @Override
    public Page<City> findAllCity(ReqBase req) {
        Page page = new Page();
        page.setCurrentPage(req.getPageIndex());
        page.setCurrentResult(req.getPageSize());
        return cityDao.findAll(page);
    }
}
